package com.exam.controller;

import com.exam.entity.ApiResult;
import com.exam.entity.FillQuestion;
import com.exam.serviceimpl.FillQuestionServiceImpl;
import com.exam.util.ApiResultHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping(value = {"/fillquestionserviceimpl"})
public class FillQuestionController {

    @Autowired
    private FillQuestionServiceImpl fillQuestionService;

    @RequestMapping("/fillQuestion")
    public ResponseEntity<Integer> add(@RequestBody FillQuestion fillQuestion) {
        int res = fillQuestionService.add(fillQuestion);
        return new ResponseEntity<Integer>(res, HttpStatus.OK);
    }

    @RequestMapping("/fillQuestionId")
    public ResponseEntity<FillQuestion> findOnlyQuestionId() {
        FillQuestion res = fillQuestionService.findOnlyQuestionId();
       return  new ResponseEntity<FillQuestion>(res,HttpStatus.OK);
}
}
